package com.ruoyi.project.para.account.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.para.account.mapper.ParaKeyAccountMapper;
import com.ruoyi.project.para.account.domain.ParaKeyAccount;
import com.ruoyi.project.para.account.service.IParaKeyAccountService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 重点账户Service业务层处理
 *
 * @author ruoyi
 * @date 2020-04-06
 */
@Service
public class ParaKeyAccountServiceImpl extends ServiceImpl<ParaKeyAccountMapper, ParaKeyAccount> implements IParaKeyAccountService
{
    @Autowired
    private ParaKeyAccountMapper paraKeyAccountMapper;

    /**
     * 查询重点账户
     *
     * @param id 重点账户ID
     * @return 重点账户
     */
    @Override
    public ParaKeyAccount selectParaKeyAccountById(String id)
    {
        return paraKeyAccountMapper.selectParaKeyAccountById(id);
    }

    /**
     * 查询重点账户列表
     *
     * @param paraKeyAccount 重点账户
     * @return 重点账户
     */
    @Override
    public List<ParaKeyAccount> selectParaKeyAccountList(ParaKeyAccount paraKeyAccount)
    {
        return paraKeyAccountMapper.selectParaKeyAccountList(paraKeyAccount);
    }

    /**
     * 新增重点账户
     *
     * @param paraKeyAccount 重点账户
     * @return 结果
     */
    @Override
    public int insertParaKeyAccount(ParaKeyAccount paraKeyAccount)
    {
        paraKeyAccount.setCreateTime(DateUtils.getNowDate());
        return paraKeyAccountMapper.insertParaKeyAccount(paraKeyAccount);
    }

    /**
     * 修改重点账户
     *
     * @param paraKeyAccount 重点账户
     * @return 结果
     */
    @Override
    public int updateParaKeyAccount(ParaKeyAccount paraKeyAccount)
    {
        paraKeyAccount.setUpdateTime(DateUtils.getNowDate());
        return paraKeyAccountMapper.updateParaKeyAccount(paraKeyAccount);
    }

    /**
     * 删除重点账户对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteParaKeyAccountByIds(String ids)
    {
        return paraKeyAccountMapper.deleteParaKeyAccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除重点账户信息
     *
     * @param id 重点账户ID
     * @return 结果
     */
    @Override
    public int deleteParaKeyAccountById(String id)
    {
        return paraKeyAccountMapper.deleteParaKeyAccountById(id);
    }
}
